home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 4
/
Aminet 4 - November 1994.iso
/
aminet
/
comm
/
fido
/
shelter191a.lha
/
rexx
/
WFREQIT.wplrx
< prev
next >
Wrap
Text File
|
1994-03-11
|
39KB
|
1,150 lines
/**/
v="$VER: FREQIT Wplrx Multi-BBS Freq Forwarder Williamson/Mollitt 52.20"
/* Based on FREQIT.rx Door for XenoLink By: Sean Mollitt (1:167/165.0) */
configpath = "CFG:freqit/freqit.cfg"
options results
signal on failure
signal on syntax
CALL PRAGMA('Stack',20000)
sv='v'||right(v,4)
script="Wfreqit"
wplport=bitor(GetClip('SHELTER'),'20'x))
/*--------------------------------- */
quote='"'
cr="\r\n"
bs='08'x
CLS='H'
Blk = '
';Red = '
'
Grn = '
';Yel = '
'
Blu = '
';Pur = '
'
Cya = '
';Wht = '
'
Off = ''
BluYel = '
' ; CyaWht = '
'
CyaBlu = '
' ; BluCya = '
'
BluWht = '
' ; BluPur = '
'
CyaPur = '
' ; GrnYel = '
'
RedYel = '
'
thing="AMM"
thing37="ADM"
thing48="ADM"
prompt0=Pur"["Cya"X"Pur"] to Skip Text, ["Cya"Return"Pur"] to continue or ["Cya"Q"Pur"]uit browsing > "Wht
prompt1=Pur"["Cya"M"Pur"]ark ["Cya"Return"Pur"] to continue or ["Cya"Q"Pur"]uit browsing > "Wht
prompt2=Pur"["Cya"M"Pur"]ark ["Cya"S"Pur"]earch ["Cya"X"Pur"] to skip text ["Cya"Return"Pur"] to continue or ["Cya"Q"Pur"]uit browsing > "Wht
prompt3=Pur"["Cya"Return"Pur"] to continue or ["Cya"Q"Pur"]uit browsing "Wht
/* standrd WPLRX interface, wbaud and wline not used in THIS script */
parse arg wbaud wline wusername
local=0
if upper(strip(wbaud)) = "SYSOP" then do
wusername="SYSOP LOCAL"
wline=0 ; local=1 ; wbaud='9600' ; cr='0a'x
close('STDOUT')
call open('STDOUT','CON:0/10/665/230/'script sv'/CLOSE','w')
call close('STDIN')
call open('STDIN','*','R')
end
call send(CLS)
call send(Pur" "script sv" (Multi-BBS File Request Forwarder)"||cr)
call send(Pur" Original XenoLink version 1.1"Cya" by Sean Mollitt "Blu" FidoNet#1:167/165"||cr)
call send(Pur" WPL.library version "Cya" by Robert Williamson "Blu" FidoNet#1:167/104"||cr)
call send(Wht" Loading config file...")
/* List of "INTERPRETed" functions */
checkbytes = "IF DATATYPE(STRIP(WORD(line.a,2),'T','k'),'N')=1 THEN check=check+1"
checkdate = "IF POS('-',WORD(line.a,3),3)= 3 & POS('-',RIGHT(WORD(line.a,3),3),1)= 1 then check=check+1"
checkdot = "IF POS('.',RIGHT(WORD(line.a,1),5))~=0 then check=check+1"
checkday = "IF POS(UPPER(LEFT(WORD(line.a,3),3)),'MON TUE WED THU FRI SAT SUN YES TOD')~=0 then check=check+1"
checkkb = "IF RIGHT(WORD(line.a,2),1)='k' & DATATYPE(STRIP(WORD(line.a,2),'T','k'))='NUM' then check = check+1"
checkbkdot = "IF DATATYPE(STRIP(WORD(line.a,2),'T','k'))='NUM' & POS('.',RIGHT(WORD(line.a,1),5))~=0 then check=check+1"
if ~OPEN('config',configpath,'R') then do
call send("Error! Cannot find the config file:"configpath||cr)
signal shutdown
end
u=0;x=0;z=0;stringn=""
readconfigline:
cfgln = TRANSLATE(READLN('config'),' ','09'x) /* strips tabs out of config */
if LEFT(STRIP(cfgln),1) ~= ';' & COMPRESS(cfgln) ~= "" then do
x=x+1
if STRIP(WORD(cfgln,1))='BBSLIST' then do
z=z+1
bbsname.z = STRIP(TRANSLATE(READLN('config'),' ','09'x))
offset= POS(';',bbsname.z)-1
if offset > 0 then bbsname.z = STRIP(LEFT(bbsname.z,offset))
filelist.z = WORD(STRIP(TRANSLATE(READLN('config'),' ','09'x)),1)
node.z = WORD(STRIP(TRANSLATE(READLN('config'),' ','09'x)),1)
time.z = WORD(STRIP(TRANSLATE(READLN('config'),' ','09'x)),1)
type.z = WORD(STRIP(TRANSLATE(READLN('config'),' ','09'x)),1)
access.z = WORD(STRIP(TRANSLATE(READLN('config'),' ','09'x)),1)
signal readconfigline
end
if STRIP(WORD(cfgln,1))='USERLEVEL' then do
u=u+1
user.u=upper(STRIP(TRANSLATE(READLN('config'),' ','09'x)))
userpriv.u=subword(user.u,words(user.u))
signal readconfigline
end
cfg.x = STRIP(STRIP(WORD(cfgln,2)),'B','"')
end
if ~EOF('config') then signal readconfigline
filedir = cfg.1
indir = cfg.2
maxreq = cfg.3
maxk = cfg.4
maxover = cfg.5
callout = cfg.6
outnode = cfg.7
txtfile = cfg.8
hlpfile = cfg.9
usrfile = cfg.10
logfile = cfg.11
msgtxt = cfg.12
msgarea = cfg.13
netarea = cgf.14
maxdays = cfg.15
outbound = cfg.16
pollcmd = cfg.17
hostaddr = cfg.18
userfs = cfg.19
loggroup = cfg.20
CALL CLOSE('config')
users=u
if wusername = "" then do
usrname=upper(strip(wprompt(120,cr||' Enter name: ')))
if usrname="" then signal shutdown
end
else usrname=upper(strip(wusername))
fixuser=translate(usrname,"_"," ")
call sendmsg
if local then do
priv=100 ; known = 1
end;else do
priv=20 ; known=0
do u=1 to users
if index(user.u,usrname) ~= 0 then do
priv=userpriv.u
known=1
end
end
end
if ~known then call send(cr||' User 'usrname', your access level is 'priv||cr)
else call send(cr||' User 'usrname', your special access level is 'priv||cr)
x=wprompt(120,Wht" [Return] to continue ")
/**/
rows=24
/**/
if priv >= maxover then do
maxk = 9000000
maxreq = 100
end
call send(Wht"AM Loading user file...level:"priv""||CR)
if ~exists(usrfile) then Address COMMAND 'echo >'usrfile
if ~OPEN('user',usrfile,'R') then do
call send("Error! Cannot find the user file (freqit.usr) "usrfile||cr)
signal shutdown
end
totwaitk=0;e=0;up=0;m=0;totk=0;totusers=0;opts = ""
readuserfile:
usrline = UPPER(READLN('user'))
if EOF('user') then signal printwait
m=m+1 ; i=0 ; files.m=0
name.m= usrline
totusers = m
if name.m = UPPER(usrname) then up = m
do FOREVER
i=i+1
usrline = READLN('user')
if WORD(usrline,1)= "#" then BREAK
PARSE VAR usrline file.m.i filek.m.i filed.m.i filea.m.i filestat.m.i fileto.m.i filedes.m.i
files.m = i
end
if ~EOF('user') then signal readuserfile
printwait:
CALL CLOSE('user')
if up ~= 0 then do
call send(CLS||cr)
call send(Pur" The following file(s) already on request:"||cr)
call send(Blu" -----------------------------------------"||cr)
do i= 1 to files.up
if filestat.up.i = 'waiting' then call send(Wht" "LEFT(file.up.i,24)||" "||RIGHT(filek.up.i,7)||cr)
totk=totk+filek.up.i
end
x=wprompt(120,Wht" [Return] to continue ")
call send(Pur" The following file(s) have been received:"||cr)
call send(Blu" -----------------------------------------"||cr)
tosend=""
do i= 1 to files.up
if filestat.up.i ~= 'waiting' then do
call send(Wht" "LEFT(file.up.i,24)||" "||RIGHT(filek.up.i,7)||cr)
tosend=tosend||" "||file.up.i
end
end
x=wprompt(120,Wht" [Return] to continue ")
usermsg=msgarea||fixuser
if exists(usermsg) then do
call display_text(usermsg)
resp=upper(wprompt(120,cr||'Do you wish to download these files now? [y/n]'))
if resp="Y" then do
call sendfiles(tosend)
call delete(usermsg)
do i= 1 to files.up
filestat.up.i = 'REMOVED'
end
signal saveuserfile
end
end
maxk = maxk - totk
maxreq = maxreq - files.up
if maxreq <= 0 then do
call send(Blu" -----------------------------------------"||cr)
call send(Red" You cannot request any more files until"||cr)
call send(" these "files.up" have been processed and received"||cr)
call send(Blu" -----------------------------------------"||cr)
x=wprompt(120,Wht" [Return] to continue ")
signal shutdown
end
call send(Blu" -----------------------------------------"||cr)
call send(Pur" You may request "Cya||maxreq||Pur" more file(s)"Cya "("||(TRUNC(maxk/1000))||"k)"Wht||cr)
call send(Blu" -----------------------------------------"||cr)
x=wprompt(120,Wht" [Return] to continue ")
signal Mainmenu
end
nofileswaiting:
up = m+1 /* up= user position in user file */
files.up = 0
name.up = UPPER(usrname)
totusers= totusers + 1
Mainmenu:
stringn=""
wfiles.up = files.up
nodeaddr="";opts=" "
call send("H
")
call send(Cya" FILE REQUEST BBS CATALOGUES "||cr)
call send(Blu" -------------------------------"||cr)
call send(Pur" The maximum number of files you"||cr)
SELECT
WHEN priv >= maxover then call send(Pur" can request is: "Cya"unlimited"||cr)
WHEN maxreq < = 0 then call send(Pur" can request is: "Cya"none"||cr)
OTHERWISE call send(Pur" can request is: "Cya||maxreq||" ("||(TRUNC(maxk/1000))||"k max)"||cr)
end
call send(Blu" -------------------------------"||cr)
call send(Blu" System Support Platform"||cr)
do i = 1 to z
if access.i <= priv then call send(Cya" ["||i||"] "pur||bbsname.i||cr)
stringn=stringn||i
end
stringn=stringn||'QHS'
call send(Blu" -------------------------------"||cr)
call send(pur" "Cya"[S]"pur" Search "Cya"[H]"pur" Help "Cya"[Q]"pur" Quit"||cr)
if priv >= maxover then do
call send(cr)
call send(pur" "Cya" Sysop Commands"||cr)
call send(Blu" "Cya" --------------"||cr)
call send(pur" "Cya" [M]"pur" Freq manager"||cr)
call send(pur" "Cya" [L]"pur" View freq log"||cr)
call send(pur" "Cya" [N]"pur" Freq new list"||cr)
stringn=stringn||'MNL'
end
cmd=UPPER(wprompt(120,Cya" Select"Wht" > "))
if cmd="" | POS(cmd,stringn)=0 then signal mainmenu
if cmd="Q" then signal Shutdown
if datatype(cmd,'N') & POS(cmd,stringn) ~=0 THEN do
call send(" retrieving file list...")
fullpath = filedir||filelist.cmd
signal openfile
end
if cmd="H" then do
call display_text(hlpfile)
x=wprompt(120,"[Return] to continue")
signal mainmenu
end
if cmd="S" then do
opts = ""
cmd=upper(wprompt(120,Cya"AM Search which file list #: "Wht))
if cmd="" then signal mainmenu
if POS(cmd,stringn)=0 then
do
x=wprompt(120,Yel"AM Enter the NUMBER of the file list to search [Return]"Wht)
signal Mainmenu
end
fullpath = filedir||filelist.cmd
result=wprompt(120,Cya"AM Search string: "Wht)
if result="" then signal mainmenu
srch= WORD(STRIP(result,'B','*'),1)
if UPPER(srch)="Q" THEN signal mainmenu
if UPPER(srch)=" " THEN signal mainmenu
call send(Pur"AM Searching file list. "Cya"[Q]"pur" to abort"Wht)
cmdline = " run search >ram:t/found "fullpath" "srch" NONUM"
wait=0
address command cmdline
options failat 20
do forever
call send(".")
if checkabort() then
do
call send("AM aborted! Showing matches..."||CR)
address command "status >ram:t/proc COMMAND = search"
address command "Break <ram:t/proc >nil: ?"
call delete("ram:t/proc")
LEAVE
end
wait = wait + 1
if wait == 5 then do
call send("D")
wait = 1
end
address command 'Status COMMAND = search'
if RC = 5 then break
end
call delay(40)
fullpath = "ram:t/found"
OPTS = "S"
call send(CR)
signal openfile
end
if cmd="L" then do
call display_text(logfile)
call send("------------------------------------------------------------------------------- "||CR)
x=wprompt(120,"[Return] to continue")
signal mainmenu
end
if cmd="N" then do
cmd=upper(wprompt(120,Cya"AM [#]"pur" of bbs to freq 'FILES' from or "Cya"[N]"pur"ew: "Wht))
if cmd="" then signal mainmenu
if POS(cmd,stringn||"N")=0 then do
x=wprompt(120,Yel"AM Enter the NUMBER of the BBS to Freq [Return]"Wht)
signal Mainmenu
end
if cmd="N" then do
result=wprompt(120,Cya"AM Node address to freq 'FILES' from : "Wht)
nodeaddr = UPPER(result)
if nodeaddr = "" then signal mainmenu
if DATATYPE(COMPRESS(nodeaddr,':/.')) ~= 'NUM' then do
x=wprompt(120,Yel"AM Not a valid node address! [Return]"Wht)
signal Mainmenu
end
end
freqlist=upper(wprompt(120,Cya"AM [Return] to freq 'FILES' or enter NEW name : "Wht))
if freqlist = "" then freqlist="FILES"
signal freqit
end
if cmd="M" then do
if files.1 = 0 THEN do
x=wprompt(120,Pur"AM Waiting freq list is empty!"Cya" [Return]")
signal mainmenu
end
k=0;l=2;v=0
call send(CLS)
call send(Pur"## User/File name bytes date out node date in destination "Wht||cr)
call send(Blu"--------------------------------------------------------------------------------"Wht||cr)
do i= 1 to totusers
l=l+1
call send( Pur||" "||LEFT(name.i,20)||CR)
do j = 1 to files.i
k=k+1 ; l=l+1
if POS('_',fileto.i.j) ~= 0 then ffileto.i.j = LEFT(fileto.i.j,1)||'.'||SUBSTR(fileto.i.j,POS('_',fileto.i.j)+1)
ELSE ffileto.i.j = fileto.i.j
call send(Cya||LEFT("["||k||"]",4)||" "||Wht||LEFT(file.i.j,20)||" "||RIGHT(filek.i.j,7)||" "||filed.i.j||" "||LEFT(filea.i.j,11)||" "RIGHT(filestat.i.j,8)" "LEFT(ffileto.i.j,11)||cr)
ffile.k = file.i.j ; ffilea.k = filea.i.j ; ffileto.k = fileto.i.j
if l >= (rows-3) | j = files.i THEN do
char=upper(wprompt(120,Cya"[R]"Pur"emove "Cya"[F]"Pur"req "Cya"[P]"pur"urge "Cya"[D]"pur"estination "Cya"[Q]"Pur"uit "Cya"[Return]"Pur" > "Wht))
if char = "Q" & v=0 then signal mainmenu
if char = "Q" & v~=0 then signal saveuserfile
if char = "R" then do
marks=0
marks=wprompt(120,"AM"Cya"Remove file request #'s : "Wht)
call send(thing)
numb = words(marks)
call send("Removing "numb" file request(s)."||CR)
if numb=0 | DATATYPE(VALUE(COMPRESS(marks))) ~= 'NUM' then signal mainmenu
v=0;r=0
do q = 1 to numb
fnum = WORD(marks,q)
if fnum > k then signal mainmenu
y=0
do r= 1 to totusers
do s= 1 to files.r
y=y+1
if y = fnum then do
v=v+1; kfiles.r = v
file.r.s = "REMOVED"
if kfiles.r = files.r then name.r="REMOVED"
/* call send("Removing user :"name.r||CR) */
end
end
end
end
call send(thing)
end
if char = "P" then do
marks=0
marks=upper(wprompt(120,"AM"Cya"Purge all files that have been received from the list? [y/N] "Wht))
if marks ~= 'Y' then signal mainmenu
v=0;r=0; y=0
do r= 1 to totusers
do s= 1 to files.r
y=y+1
if filestat.r.s ~= 'waiting' then do
v=v+1; kfiles.r = v
file.r.s = "REMOVED"
if kfiles.r = files.r then name.r="REMOVED"
/* call send("Removing user :"name.r||CR) */
end
end
end
call send(thing)
end
if char = "F" then do
marks=0
marks=wprompt(120,"AM"Cya"Freq file #'s : "Wht)
call send(thing)
numb = words(marks)
call send("Freqing "numb" file(s)."||CR)
if numb=0 | DATATYPE(VALUE(COMPRESS(marks))) ~= 'NUM' then signal mainmenu
do q = 1 to numb
fnum = WORD(marks,q)
if fnum > k then signal mainmenu
call makereq(ffilea.fnum,ffile.fnum)
call send(".")
end
call send(thing)
end
if char = "D" then do
marks=0;destin=""
fmark=wprompt(120,"AM"Cya"Change Destination of what file # : "Wht)
if DATATYPE(fmark) ~= 'NUM' then BREAK
numb = words(marks)
if numb >1 | DATATYPE(VALUE(COMPRESS(marks))) ~= 'NUM' then signal mainmenu
call send(thing37)
marks=upper(wprompt(120,Cya"[U]"pur"ser "Cya"[O]"Pur"ther user "Cya"[N]"pur"ode or "Cya"[F]"pur"ile section > "Wht))
if marks='U' then destin = "USER"
if marks='O' then do
call send(thing48)
destin=UPPER(TRANSLATE(wprompt(120,Cya"User name to send file # ["fmark"] to : "Wht),'_',' '))
end
if marks='F' then do
call send(thing1)
destin=wprompt(120,Cya"Section number to send file # ["fmark"] to : "Wht)
end
if marks='N' then do
call send(thing48)
destin=wprompt(120,Cya"Node address to forward file # ["fmark"] to : "Wht)
if POS(':',destin) = 0 | DATATYPE(COMPRESS(destin,':/.')) ~= 'NUM' then do
x=wprompt(120,Yel"AM Not a valid node address! [Return]"Wht)
signal Mainmenu
end
end
if destin="" then BREAK
v=0;r=0; y=0
do r= 1 to totusers
do s= 1 to files.r
y=y+1
if y = fmark then do
if filestat.r.s ~= 'waiting' then
do
x=wprompt(120,"AM"pur"Only "cya"waiting"pur" files can be edited!")
end;else do
fileto.r.s = destin
v=v+1
end
end
end
if v~=0 then break
end
call send(thing)
end
call send(thing)
l=0
end
end
l=l+1
end
call send(Blu"AM--------------------------------------------------------------------------------"Wht||cr)
x=wprompt(120,Pur"end of list."Cya" [Return] "Wht)
if v ~=0 then signal saveuserfile
end
signal mainmenu
openfile:
r=0;a=0;b=0;c=0;d=0;kbt=0;totnk=0;deslen=0
gototype = "signal "||type.cmd
if type.cmd = "NBDI" then deslen=39
if type.cmd = "NKDI" then deslen=43
if type.cmd = "NBI" then deslen=45
if ~OPEN('input',fullpath,'R') then do
call send("Error. Cannot open "fullpath||CR)
signal shutdown
end
call send(CLS)
/*
a= # of current line
b= # valid file name
c= # lines scrolled
d= # marked files
e= # of waiting files
*/
nextlinepos=0
check=0 ;
firstlines:
if opts ~= "S" THEN do
a=a+1;c=c+1
if c = rows-3 THEN do
marks=wprompt(120,prompt0)
if marks="" then marks="C"
if UPPER(marks)="Q" then signal alldone
if UPPER(marks)=' ' | UPPER(marks)="X" then do
i=0;
call send("AM")
do UNTIL COMPRESS(STRIP(READLN('input'),'T','0D'x))="" | i=300
i=i+1
if EOF('input') | checkabort() then BREAK
call send("M"||"skipping "||LEFT(i,4)||"D")
end
i=0 ; BREAK
end
call send("AAMM")
c=0
end
line.a = STRIP(READLN('input'),'T','0D'x)
if type.cmd = "NBI" THEN INTERPRET checkbkdot
ELSE INTERPRET checkdate
if check = 0 THEN call send(line.a||CR)
ELSE signal findtype
signal firstlines
end
startloop:
a=a+1 ; check=0 ; pref= ""
line.a = STRIP(READLN('input'),'T','0D'x)
if opts = "S" then signal findtype
if COMPRESS(LEFT(line.a,25))="" & nextlinepos ~=0 then do
r=r+1
PARSE VAR line.a ldes.b.r
line.a = ""||nextlinepos||"C"||LEFT(STRIP(ldes.b.r),deslen) /* much faster this way */
signal printit
end
findtype:
check=0
INTERPRET gototype
NBDI:/* Name,Bytes,Date,Info */
INTERPRET checkbytes
if check~=0 then do
INTERPRET checkdate
if check=2 then signal NBDIdo
INTERPRET checkdot
if check=2 then signal NBDIdo
INTERPRET checkday
if check < 2 THEN nextlinepos=0
end
signal printit
NBDIdo:
b=b+1 ; r=1
PARSE VAR line.a lname.b lsize.b ldate.b ldes.b.r
ldes.b.r=STRIP(ldes.b.r)
pref = Cya||LEFT("["||b||"]",6)||Wht
line.a = LEFT(lname.b,16)||" "||RIGHT(lsize.b,7)||" "||LEFT(ldate.b,9)||" "||LEFT(ldes.b.r,38)
nextlinepos = WORDINDEX(line.a,4)+5
signal printit
NKDI: /* Name,Kilobytes,Date,Info */
INTERPRET checkkb
INTERPRET checkdate
if check=2 then signal NKDIdo
INTERPRET checkdot
if check=2 then signal NKDIdo
INTERPRET checkday
if check < 2 THEN nextlinepos=0
signal printit
NKDIdo:
b=b+1 ; r=1
PARSE VAR line.a lname.b lsize.b ldate.b ldes.b.r
ldes.b.r=STRIP(ldes.b.r)
pref = Cya||LEFT("["||b||"]",6)||Wht
line.a = LEFT(lname.b,14)||" "||RIGHT(lsize.b,5)||" "||LEFT(ldate.b,9)||" "||LEFT(ldes.b.r,deslen)
lsize.b = VALUE(STRIP(lsize.b,'T','k'))*1000
nextlinepos = WORDINDEX(line.a,4)+5
signal printit
NBI: /* Name,Bytes,Info */
INTERPRET checkbkdot
if check = 1 THEN signal NBIdo
nextlinepos=0
signal printit
NBIdo:
b=b+1 ; r=1
PARSE VAR line.a lname.b lsize.b ldes.b.r
ldes.b.r=STRIP(ldes.b.r)
pref = Cya||LEFT("["||b||"]",6)||Wht
line.a = LEFT(lname.b,14)||" "||RIGHT(lsize.b,5)||" "||LEFT(ldes.b.r,deslen)
nextlinepos = WORDINDEX(line.a,3)+5
signal printit
printit:
if opts ~= "S" | (opts = "S" & pref ~="") THEN do
c=c+1
call send(pref||line.a||CR)
signal markit
end
markit:
/* if checkabort() then signal alldone */
if c < rows-3 & ~EOF('input') then signal startloop
if c = rows-3 | EOF('input') then do
c=0
SELECT
WHEN opts ="S" THEN x=prompt1
WHEN b ~= 0 THEN x=prompt2
WHEN b = 0 THEN x=prompt3
end
marks = wprompt(120,x)
if marks="" then marks="C"
call send(cr)
if UPPER(marks)='Q' then signal alldone
if UPPER(marks)='S' then do
parsetype = "signal "||type.cmd||"do"
marks=wprompt(120,Cya"AMEnter search string: "Wht)
if marks="" then BREAK
i=0
call send("AM")
sline = STRIP(READLN('input'),'T','0D'x)
do WHILE POS(marks,sline)=0 | COMPRESS(LEFT(sline,25)) = ""
sline = STRIP(READLN('input'),'T','0D'x)
/* len = LENGTH(sline) */
i=i+1;if EOF('input') then BREAK
call send("M"||"searching "||LEFT(i,4)||"D")
end
i=0 ; line.a = sline ; INTERPRET parsetype
end
if UPPER(marks)=' ' | UPPER(marks)="X" then do
i=0
call send("AM")
do UNTIL COMPRESS(STRIP(READLN('input'),'T','0D'x))="" | i=300
i=i+1;if EOF('input') then BREAK
call send("M"||"skipping "||LEFT(i,4)||"D")
end
i=0 ; BREAK
end
if UPPER(marks)='M' then do
marks=wprompt(120,Cya"AMMark file numbers: "Wht)
numb=words(marks)
if numb=0 then BREAK
if DATATYPE(COMPRESS(marks))~='NUM' then do
x=wprompt(120,"AMFile *NUMBERS* only! [Return]")
marks=wprompt(120,Cya"AMMark file numbers: "Wht)
numb=words(marks)
if numb=0 then BREAK
end
do i=1 to numb
if WORD(marks,i) > b THEN do
x=wprompt(120,"AMNumber out of range! [Return]")
marks=wprompt(120,Cya"AMMark file numbers: "Wht)
numb=words(marks)
if numb=0 then BREAK
end
end
do i=1 to numb
d=d+1
filenumb = WORD(marks,i)
/* call send(lname.filenumb||' added') */
/* if totk + lsize.filenumb > maxk then signal maxkreached */
if lsize.filenumb > maxk then signal maxkreached
if d > maxreq then signal maxfreached
files.up = files.up + 1
u = files.up
file.up.u = lname.filenumb
filek.up.u = lsize.filenumb
filed.up.u = DATE('E')
filea.up.u = node.cmd
filestat.up.u = 'waiting'
fileto.up.u = 'USER'
filedes.up.u = "" ; j=1
do WHILE SYMBOL(ldes.filenumb.j) ~= 'LIT'
filedes.up.u = filedes.up.u||' '||STRIP(ldes.filenumb.j)
j=j+1
if j=100 then break
end
if POS('[',WORD(filedes.up.u,1))~=0 THEN filedes.up.u = STRIP(DELWORD(filedes.up.u,1,1))
j=0
totk = totk + lsize.filenumb
totnk = totnk + lsize.filenumb
end
if UPPER(cs) = 'N' THEN signal alldone
end
call send("AMAM")
end
if ~EOF('input') THEN signal startloop
call wprompt(120,Pur"end of file list! [Return]"Wht)
call send(CLS)
signal alldone
maxkreached:
call wprompt(120,Yel"Maximum bytes exeeded! [Return] to continue"Wht)
d=d-1
/* files.up = files.up - 1*/
/* call send("max allowed: "maxk */
call send("total bytes: "totk||cr)
call send("last file : "lsize.filenumb||cr)
call wprompt(120,"")
signal alldone
maxfreached:
call wprompt(120,Yel"Maximum number of files reached! [Return] to continue"Wht)
d=d-1
/*files.up = files.up - 1 */
/*
a= # of current line
b= # valid file name
c= # lines scrolled
d= # marked files
e= # of waiting files
*/
alldone:
call CLOSE('input')
if d = 0 then signal mainmenu
call send(CLS)
i = wfiles.up + 1
freqlist=" "
call send(Pur" You have Requested the following "||d||" file(s)"Wht||cr)
call send(Blu" --------------------------------------------------"Wht||cr)
do a=i to files.up
freqlist=freqlist||file.up.a||" "
call send(" "||LEFT(file.up.a,30)||" "||RIGHT(filek.up.a,7)||cr)
end
call send(Blu" --------------------------------------------------"||cr)
call send(Pur" Total bytes: "RIGHT(totnk,8)||cr)
call send(Blu" --------------------------------------------------"||cr)
if wusername="SYSOP LOCAL" then do
answer=upper(wprompt(120,Cya" Are you sure you want to freq these files?"Pur" [Y/n] "Wht))
if answer ="N" then signal mainmenu
end;else do
answer=upper(wprompt(120,Cya" Are you sure you want to freq these files?"Pur" [y/N] "Wht))
if answer ~="Y" then signal mainmenu
end
maxk = maxk - totnk
maxreq = maxreq - d
freqit:
if Nodeaddr="" then Nodeaddr = node.cmd
call makereq(Nodeaddr,freqlist)
if Nodeaddr=hostaddr then do
call localfreq
signal mainmenu
end;else if PRIV >= callout then do
if wusername="SYSOP LOCAL" then do
cmdline='Execute 'pollcmd Nodeaddr
address COMMAND cmdline
call send(Pur" OK... "||yel||pollcmd Nodeaddr||pur||" queued." Wht)
end;else do
answer=upper(wprompt(120,Pur||cr||" Would you like the bbs to call out and do the"||cr||" file request as soon as a line is free?"Cya" [y/N] "Wht))
if answer ="Y" then do
cmdline='Execute 'pollcmd Nodeaddr
address COMMAND cmdline
x=wprompt(120,Pur" OK... "||yel||pollcmd Nodeaddr||pur||" queued. [Return]" Wht)
end
end
if freqlist="FILES" then signal mainmenu
call send(CLS)
end
donetext:
call display_text(txtfile)
saveuserfile:
call send(Cya" Saving data..."||CR)
if ~OPEN('userw',usrfile,'W') then do
call send("Error! Cannot open user file ("||usrfile||")"||cr)
signal shutdown
end
o=0;p=0;q=0;r=0
do o = 1 to totusers
if name.o ~= "REMOVED" THEN CALL WRITELN('userw',name.o)
do p = 1 to files.o
filedat= LEFT(file.o.p,20)||" "||RIGHT(filek.o.p,7)||" "||filed.o.p||" "||filea.o.p||" "||LEFT(filestat.o.p,8)||" "||fileto.o.p||" "||filedes.o.p
if file.o.p ~= "REMOVED" THEN CALL WRITELN('userw',filedat)
end
if name.o ~= "REMOVED" THEN CALL WRITELN('userw','#')
end
CALL CLOSE('userw')
rereaduserfile:
if ~OPEN('user',usrfile,'R') then do
call send("Error! Cannot find the user file (freqit.usr) "usrfile||CR)
signal shutdown
end
totwaitk=0;e=0;up=0;m=0;totk=0;totusers=0;opts = "";files.1=0
do WHILE ~EOF('user')
usrline = UPPER(READLN('user'))
if EOF('user') then BREAK
m=m+1 ; i=0 ; files.m=0
name.m= usrline
totusers = m
if name.m = UPPER(usrname) then up = m
do FOREVER
i=i+1
usrline = READLN('user')
if WORD(usrline,1)= "#" then BREAK
PARSE VAR usrline file.m.i filek.m.i filed.m.i filea.m.i filestat.m.i fileto.m.i filedes.m.i
files.m = i
end
end
CALL CLOSE('user')
if up=0 then do
up = m+1
files.up = 0
name.up = UPPER(usrname)
totusers= totusers + 1
end
call wprompt(120," OK [Return]"Pur" to continue ")
signal mainmenu
Shutdown:
call send(CLS)
EXIT
/* wpl interface */
makereq: procedure expose outbound reqname
a=arg(1)
reqs=arg(2)
parse var a z ':' n '/' f '.' p
reqname=upper(outbound||z'.'n'.'f'.'p||".REQ")
if ~Open('reqfile',reqname,'A') then do
if ~Open('reqfile',reqname,'W') then do
say "Error opening" reqname
call cleanup
Exit 1
end
end
do fi=1 to words(reqs)
call WriteLN('reqfile',strip(word(reqs,fi))||'0d'x)
end
call Close('reqfile')
address COMMAND 'FileNote' reqname address
return
checkabort:
ctlc=winput(1)
if UPPER(ctlc) = "Q" | ctlc = '03'x then return 1
return 0
display_text: procedure expose rows CLS bs cr quote local
textfile=arg(1)
call send(CLS)
if ~open('tf',textfile,"R") then do
call Send(cr||'Sorry, unable to find 'textfile||cr)
return 0
end
call send(cr)
lines=0
do while ~eof('tf')
if ~local then do
'CheckCarrier'
if RC~=0 then do
call close('tf')
call cleanup
exit
end
end
/* if checkabort() then return */
call send(readln('tf')||cr)
lines=lines+1
if lines=rows then do
lines=0
resp=wprompt(60,cr||'More(Y,n): ')
if upper(resp) = "N" then
do
call close('tf')
call send(cr)
return 0
end;else do
call send(copies(bs,12))
end
end
end
call close('tf')
call send(cr)
return 0
sendmsg:
mfile='LOG:RFSacct/'fixname||'.0.0.0.0.m'
if exists(mfile) then do
call send(cr||" The sysop left this personal message for you, "word(fname,1)||cr)
call open('am',mfile,'R')
do while ~eof('am')
line=readln('am')
y=pos(cr,line)
if y ~= 0 then call send(line'\n')
else call send(line||cr)
end
call close('am')
end
return
localfreq:
if local then return 0
call send(cr||' Please WAIT, searching local bases for requested files')
address=fixuser||"#0:0/0.0"
call putlog("WfreqIt session with "address)
'Set remote.address' address
'SetA remote $(remote.address)'
'Set remote.network FIDO'
'BeginSession $(remote.address)'
call send(cr||' You have a few seconds to MAKE SURE Zmodem is your')
call send(cr||' default protocol and AutoDownLoad and ADL Challenge is ON'||cr)
if userfs="TRUE" then address "REXX" 'Ram:rexx/RFS.rexx' wplport wline wbaud 'WFREQIT#'hostaddr reqname 0 address usrname
else Address COMMAND 'XfreqSH CFG:freq.cfg RAM:freq.lst' req reqname address
call send(cr||' Ready! '||cr)
'CheckCarrier'
if RC~=0 then do
call putlog(usrname 'dropped carrier during search')
call cleanup
exit
end
'Set req TRUE fsend TRUE protocol ZMODEM'
'SetMailerFlags "DN,PN"'
'XprSetup xprzedzap.library TN,ON,B8,F0,E30,AN,DN,KN,SN,RN,NN,M1024'
'SetUpDate "CON:0/$($(line).w_offset)/640/130/Wfreqit $(protocol) $(remote.address)/AUTO/SCREEN$(pscreen)"'
'XprSend ""'
'XprClose'
'SetUpDate NULL'
'EndSession all'
return
sendfiles:
if local then return 0
freqs=arg(1)
call putlog("FREQIT Send")
call send(' Please make sure that Zmodem is your default protocol and'||cr)
call send(' that Autodownload and ADL Challenge are turned on.'||cr)
address=fixuser||"#0:0/0.0"
'Set protocol ZMODEM fsend TRUE remote.address 'address
'XprSetup xprzedzap.library "TN,ON,B8,F0,E30,AN,DN,KN,SY,RN,M1024"'
'SetUpDate "CON:0/60/640/$($(line).w_offset)/$(protocol) Freqit Server/AUTO/SCREEN$(pscreen)"'
do i=1 to words(freqs)
'XprSetFile' indir||word(freqs,i) word(freqs,i) 'O'
call send(' Sending' indir||word(freqs,i) 'as 'word(freqs,i)||cr)
end
do i=1 to words(freqs)
'XprSend' word(freqs,i)
end
'XprClose'
'SetUpDate NULL'
return 0
/*
break_c:
break_d:
call cleanup
exit 10
novalue:
call template_oops "Novalue" sigl
syntax:
call template_oops "Syntax(RC=" || RC || ")" sigl rc
failure:
call template_oops "Failure(RC=" || RC || ")" sigl
ioerr:
call template_oops "IOErr" sigl
halt:
call template_oops "Halt" sigl
template_oops:
parse arg what badline code
call send(cr||'ERROR: Line:'badline what 'please inform sysop'||cr)
if code ~= "" then call putlog("FREQIT: Error Line "badline what errortext(code))
else call putlog("FREQIT: Error Line "badline what)
call cleanup
exit(40)
*/
/**/
syntax:
call send(cr||"SYNTAX ERROR LINE:" SIGL)
call send(cr||"Please inform the sysop")
call wprompt(120," [Return] ")
EXIT
error:
call send(cr||"RC CODE: "RC||CR)
call send("ERROR LINE: "SIGL||CR)
signal mainmenu
failure:
call send(cr||"RC CODE: "RC||CR)
call send("FAILURE LINE: "SIGL||CR)
signal mainmenu
if RC=5 THEN
do
x=wprompt(120,Cya"AM No matches found for "Yel||srch||Cya" [Return]")
signal mainmenu
end
call send(cr||"DOS COMMAND ERROR!, could not find something?"||CR)
call send("Please inform the sysop."||CR)
call send("RC CODE: "||RC||CR)
EXIT
cleanup:
Return
send:
if ~local then
do
'Print' quote||arg(1)||quote
'Send' quote||arg(1)||quote
end
else do
if index(arg(1),'0a'x) = 0 then call writeln( 'STDOUT', arg(1) )
else call writech( 'STDOUT', arg(1) )
end
return
wprompt:
if ~local then
do
'Print' quote||arg(2)||quote
'Send' quote||arg(2)||quote
end
else options PROMPT arg(2)
winput:
if local then
do
parse pull ustring
return ustring
end
else do
'GetInbound E0 'arg(1)
'String $(event)'
if upper(RESULT) = 'CARRIER' then
do
call putlog("Dropped Carrier")
call cleanup
exit
end
else if upper(RESULT) = 'LOGIN' then
do
'String $(namebuf)'
return (RESULT)
end
return ""
end
putlog:
Address "LOGPROC" "Putlog "loggroup time() wline script arg(1)
return